﻿#region Copyright ©2008-2009, Technische Universitaet Muenchen
// ====================================================================================================
//
// Last Changed by       $Author: kalus $
// Last Changed Date     $LastChangedDate: 2009-03-18 16:42:33 +0100 (Wed, 18 Mar 2009) $
// Last Changed Revision $Rev: 36 $
//
// ====================================================================================================
#endregion

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

using Tum.CollabXT;

namespace Tum.CollabXT.SPEM
{
    public class Milestone : IMilestone
    {
        #region Private Members
        private string _Id;
        private string _Name;
        private string _TypeName;
        private string _Description;
        private Dictionary<string, object> _ExtendedData = new Dictionary<string, object>();

        private DateTime _ScheduledDate;
        private int _ScheduleNumber;
        private List<IMilestone> _Predecessors;
        #endregion

        public Milestone() { }
        public Milestone(XmlNode node) 
        {
            _Id = node.Attributes["id"].Value;
            _Name = node.Attributes["name"].Value;
            _Description = node.Attributes["briefDescription"].Value;
        }

        public override string ToString()
        {
            return _Id + " (" + _Name + ")";
        }

        #region IMilestone Members

        public DateTime ScheduledDate
        {
            get { return (_ScheduledDate); }
            set { _ScheduledDate = value; }
        }

        public int ScheduleNumber
        {
            get { return (_ScheduleNumber); }
            set { _ScheduleNumber = value; }
        }

        public List<IMilestone> Predecessors
        {
            get { return (_Predecessors); }
            set { _Predecessors = value; }
        }

        public string TypeName
        {
            get { return _TypeName; }
            set { _TypeName = value; }
        }

        #endregion

        #region IProcessElement Members

        public string Id
        {
            get { return (_Id); }
            set { _Id = value; }
        }

        public string Name
        {
            get { return (_Name); }
            set { _Name = value; }
        }

        public string Description
        {
            get { return (_Description); }
            set { _Description = value; }
        }

        public Dictionary<string, object> ExtendedData
        {
            get { return _ExtendedData; }
        }

        #endregion
    }
}
